import Vue from 'vue'
import App from './App.vue'
import router from './router'
import './plugins/element.js'
import less from 'less'
import qs from 'qs'
import axios from 'axios'
Vue.use(less)
// 导入字体图标
import './assets/fonts/iconfont.css'
// 导入全局样式表
import './assets/css/global.css'

import VCharts from 'v-charts'
Vue.use(VCharts)

// 配置请求的跟路径
axios.defaults.baseURL = 'http://api.gker.com/api'
axios.defaults.withCredentials = true
//配置请求拦截器
axios.interceptors.request.use(config =>{
  config.headers.Authorization = window.sessionStorage.getItem('token')
  return config
})

import SkuForm from 'vue-sku-form'
Vue.use(SkuForm)

// 引入全局配置文件
import $conf from "./common/config/config.js"
Vue.prototype.$conf = $conf
Vue.prototype.$qs = qs
Vue.prototype.$http = axios
Vue.config.productionTip = false
new Vue({
  router,
  render: h => h(App)
}).$mount('#app')
